package com.micro.user.service;

import com.micro.user.entity.Passenger;

import java.time.LocalDate;
import java.util.List;

/**
 * 乘客服务接口
 * 
 * @author micro
 * @since 1.0.0
 */
public interface PassengerService {

    /**
     * 添加乘客
     */
    Passenger addPassenger(Long userId, Passenger passenger);

    /**
     * 更新乘客信息
     */
    Passenger updatePassenger(Long passengerId, Passenger passenger);

    /**
     * 删除乘客
     */
    boolean deletePassenger(Long passengerId);

    /**
     * 根据乘客ID获取乘客信息
     */
    Passenger getPassengerById(Long passengerId);

    /**
     * 根据用户ID获取乘客列表
     */
    List<Passenger> getPassengersByUserId(Long userId);

    /**
     * 根据身份证号获取乘客信息
     */
    Passenger getPassengerByIdCardNumber(String idCardNumber);

    /**
     * 根据乘客类型获取乘客列表
     */
    List<Passenger> getPassengersByType(Integer passengerType);

    /**
     * 根据性别获取乘客列表
     */
    List<Passenger> getPassengersByGender(Integer gender);

    /**
     * 根据年龄范围获取乘客列表
     */
    List<Passenger> getPassengersByAgeRange(int minAge, int maxAge);

    /**
     * 获取所有活跃乘客
     */
    List<Passenger> getAllActivePassengers();

    /**
     * 统计指定用户的乘客数量
     */
    Long countPassengersByUserId(Long userId);

    /**
     * 统计指定乘客类型的乘客数量
     */
    Long countPassengersByType(Integer passengerType);

    /**
     * 根据用户ID和乘客姓名查找乘客
     */
    Passenger getPassengerByUserIdAndName(Long userId, String passengerName);

    /**
     * 验证乘客信息
     */
    boolean validatePassenger(Passenger passenger);

    /**
     * 检查身份证号是否已被使用
     */
    boolean isIdCardNumberUsed(String idCardNumber);

    /**
     * 批量添加乘客
     */
    List<Passenger> batchAddPassengers(Long userId, List<Passenger> passengers);

    /**
     * 批量更新乘客
     */
    boolean batchUpdatePassengers(List<Passenger> passengers);

    /**
     * 批量删除乘客
     */
    boolean batchDeletePassengers(List<Long> passengerIds);

    /**
     * 获取乘客统计信息
     */
    PassengerStatistics getPassengerStatistics();

    /**
     * 乘客统计信息内部类
     */
    class PassengerStatistics {
        private Long totalCount;
        private Long adultCount;
        private Long childCount;
        private Long studentCount;
        private Long specialCount;
        private Long maleCount;
        private Long femaleCount;

        // Getters and Setters
        public Long getTotalCount() { return totalCount; }
        public void setTotalCount(Long totalCount) { this.totalCount = totalCount; }

        public Long getAdultCount() { return adultCount; }
        public void setAdultCount(Long adultCount) { this.adultCount = adultCount; }

        public Long getChildCount() { return childCount; }
        public void setChildCount(Long childCount) { this.childCount = childCount; }

        public Long getStudentCount() { return studentCount; }
        public void setStudentCount(Long studentCount) { this.studentCount = studentCount; }

        public Long getSpecialCount() { return specialCount; }
        public void setSpecialCount(Long specialCount) { this.specialCount = specialCount; }

        public Long getMaleCount() { return maleCount; }
        public void setMaleCount(Long maleCount) { this.maleCount = maleCount; }

        public Long getFemaleCount() { return femaleCount; }
        public void setFemaleCount(Long femaleCount) { this.femaleCount = femaleCount; }
    }
}
